﻿/*
* 这里主要放的是使用regex字符串中某些字符的方法实现
*/
#include "RegexHeaders.h"

int ReplaceByRegex(string& in, regex pattern) {
    try
    {
        std::cout << regex_replace(in, pattern, "") << std::endl;
        //std::cout << regex_replace(in, pattern, "\L$1") << std::endl;
    }
    catch (const std::exception& err)
    {
        cout << err.what() << endl;
    }

    return 0;
}

int ReplaceByRegex(string& in, regex pattern, const string replace) {
    try
    {
        std::cout << regex_replace(in, pattern, replace) << std::endl;
    }
    catch (const std::exception& err)
    {
        cout << err.what() << endl;
    }

    return 0;
}
